package com.lun.blog.controller.web;

import com.lun.blog.pojo.FriendLinks;
import com.lun.blog.service.FriendLinksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author fangLJ
 * @creatTime 2021/3/7
 */
@Controller
@RequestMapping("/web/friend")
public class FriendController {

    @Autowired
    FriendLinksService friendLinksService;

    @GetMapping("/toFriend")
    public String toFriend(Model model){
        List<FriendLinks> links = friendLinksService.findAllFriendLinks();
        model.addAttribute("links",links);
        return "friends";
    }
}
